<xsl:stylesheet	version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes"/>

<xsl:include href="preferences.xsl"/>
<xsl:include href="index-options.xsl"/>
<xsl:include href="detail-options.xsl"/>
<xsl:include href="templates.xsl" />
<xsl:template match="details/preferences"></xsl:template>

<xsl:include href="!MovieDetailPages/Details-Movie-meow-1.xsl" />
<xsl:include href="!MovieDetailPages/Details-Movie-meow-1-options.xsl" />
<xsl:include href="!MovieDetailPages/Details-Movie-1.xsl" />
<xsl:include href="!MovieDetailPages/Details-Movie-1-options.xsl" />
<xsl:include href="!MovieDetailPages/Details-Movie-2.xsl"/>
<xsl:include href="!MovieDetailPages/Details-Movie-2-options.xsl"/>
<xsl:include href="!TVDetailPages/Details-Tv-1.xsl" />
<xsl:include href="!TVDetailPages/Details-Tv-1-options.xsl" />
<xsl:include href="!TVDetailPages/Details-Tv-meow-1.xsl" />
<xsl:include href="!TVDetailPages/Details-Tv-meow-1-options.xsl" />


<xsl:template match="details/movie">

<xsl:variable name="moviepath"><xsl:call-template name="substring-before-last"><xsl:with-param name="string" select="files/file[1]/fileURL" /><xsl:with-param name="delimiter" select="'/'" /></xsl:call-template></xsl:variable>


<html>
<head>
  <meta	http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <link	rel="StyleSheet" type="text/css" href="exportdetails_item_popcorn.css"></link>

<xsl:choose>

<!--********************************Options for Movie Detail Pages*************************************-->
<xsl:when test="season=-1">
		<xsl:if test="$detail-page='meow'">
			<xsl:call-template name="meow-movie-style"></xsl:call-template>
		</xsl:if>
		<xsl:if test="$detail-page='details2'">
			<xsl:call-template name="movie-details-2-style-and-script"></xsl:call-template>
		</xsl:if>
		<xsl:if test="$detail-page='details1'">
			<xsl:call-template name="movie-details-option-1-style-and-script"></xsl:call-template>
		</xsl:if>
</xsl:when>
<!--*********************End of option for movie Detail pages***********************************************-->

<!--***********************************scripts/sttyle for tv detail pages*************************************************************-->

<xsl:when test="season != -1">
	<xsl:if test="$tv-page='meow'">
		<xsl:call-template name="meow-tv-style"></xsl:call-template>
	</xsl:if>
	<xsl:if test="$tv-page='details1'">
		<xsl:call-template name="tv-details-1-style-and-script"></xsl:call-template>
	</xsl:if>
</xsl:when>
<!--******************************************End of options for tv episode detail pages*****************************************-->





</xsl:choose>

<!--******************************************Navigation, is same and used by all page types************************************-->
<script>


function alphaud(x)	//moves	the letters left and right 
	{
	var glen = alphaim.length
	var ending = glen - 1
	var last = ending - 1

		 if (alphaid+x<xsl:value-of select="'&lt;'" disable-output-escaping="yes"/>0)
		 {
		 alphaid=ending
		 }
		 else if (alphaid+x<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>ending)
		 {
		 alphaid=0
		 }
		 else 
		 {
		    alphaid=alphaid+x
			}

		    var	twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")
		 
					document.getElementById('change').firstChild.nodeValue=twoItems[0];
				   document.getElementById('change').setAttribute("href", twoItems[1]);
	}

 function genrelist(x)	//moves	the genres left	and right
	{
	var glen = genreim.length
	var ending = glen - 1
	var last = ending - 1

		 if (genrecnt+x<xsl:value-of select="'&lt;'" disable-output-escaping="yes"/>0)
		 {
		 genrecnt=ending
		 }
		 else if (genrecnt+x<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>ending)
		 {
		 genrecnt=0
		 }
		 else 
		 {
		   genrecnt=genrecnt+x;
		 }

		   var genreItems = genreim[(genrecnt +	genreim.length)	% genreim.length].split(",")
		   
		   document.getElementById('change').firstChild.nodeValue=genreItems[0];
				   document.getElementById('change').setAttribute("href", genreItems[1]);
			
	}

 function loadletter()	//change the list to letters 
	{
		flag=0
		{
		   alphaid=alphaid
		   var twoItems	= alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")
		  

		   document.getElementById('change').firstChild.nodeValue=twoItems[0];
				   document.getElementById('change').setAttribute("href", twoItems[1]);

		}
return false
	}

 function loadgenre()	//change the list to genres 
	{
     flag=1
		{
			genrecnt=genrecnt		
		  var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		   
		   document.getElementById('change').firstChild.nodeValue=genreItems[0];
				   document.getElementById('change').setAttribute("href", genreItems[1]);
	
			 }
		return
	}
function upDown(x)
{
  if (flag== 0)
    alphaud(x)
  else
    genrelist(x)
  return false
  }

 function changeformat()
 {
 if (flag==0) 
	{
	loadgenre()
	}
 else
	{
	loadletter()
	}
}


</script>
<!--****************************************END of NAVIGATION SCRIPTS*********************************************************************-->


  <title><xsl:value-of select="title"/></title>
</head>


<!--*************Movie Background options for use in the skin do not change unless you're sure you know	what you're doing*****************-->

<!--Background option, have your background file in the	same place as the html file and	name the same as the video file	with the name imdb#.jpg.  Example:  batman.avi,	batman.html, tt#####.jpg-->
<xsl:variable name="imdb"><xsl:value-of	select="$moviepath" />/<xsl:value-of select="id"/>.png</xsl:variable>

<!--Background option, have your background file in the	same place as the html file and	name the same as the video file	with .fanart after it.	Example:  batman.avi, batman.html, batman.fanart.jpg-->
<xsl:variable name="moviebg-w-yamj"><xsl:call-template name="substring-before-last"><xsl:with-param name="string" select="details" /><xsl:with-param name="delimiter" select="'.'" /></xsl:call-template>.fanart.jpg</xsl:variable>

<!--Background option, have your background file in the	same place as the video	file and name the same as the video file with .fanart after it.	 Example:  batman.avi, batman.html, batman.fanart.jpg-->
<xsl:variable name="movie.fanart-w-videofile"><xsl:value-of select="$moviepath"	/>/<xsl:call-template name="substring-before-last"><xsl:with-param name="string" select="details" /><xsl:with-param name="delimiter" select="'.'" /></xsl:call-template>.fanart.jpg</xsl:variable>

<!--Background option, have your background file in the	same place as the video	file and name the same as the video file with .fanart after it.	 Example:  batman.avi, batman.html, batman.fanart.jpg-->
<xsl:variable name="movie.fanart2-w-videofile"><xsl:value-of select="$moviepath" />/<xsl:call-template name="substring-before-last"><xsl:with-param name="string" select="details" /><xsl:with-param name="delimiter" select="'.'" /></xsl:call-template>.fanart2.jpg</xsl:variable>

<!--Background option, have your background file in the	same place as the video	file and name the same as the video file with -fanart after it.	 Example:  batman.avi, batman.html, batman.fanart.jpg-->
<xsl:variable name="movie-fanart-w-videofile"><xsl:value-of select="$moviepath"	/>/<xsl:call-template name="substring-before-last"><xsl:with-param name="string" select="details" /><xsl:with-param name="delimiter" select="'.'" /></xsl:call-template>-fanart.jpg</xsl:variable>

<!--This variable sets the movie fanart	to be named fanart.jpg inside the location of the movie	video file-->
<xsl:variable name="moviefanart"><xsl:value-of select="$moviepath" />/fanart.jpg</xsl:variable>

<!--Background option, have your background file in a custom created directory and filename.fanart.jpg after it.  Example:  batman.avi,	batman.html, batman.fanart.jpg-->
<xsl:variable name="movie-fanart-w-customfolder">fanart/<xsl:call-template name="substring-before-last"><xsl:with-param	name="string" select="details" /><xsl:with-param name="delimiter" select="'.'" /></xsl:call-template>.fanart.jpg</xsl:variable>

<!--Background option, have your background file in a custom created directory and filename.fanart.jpg after it.  Example:  batman.avi,	batman.html, batman.fanart.jpg-->
<xsl:variable name="movie-fanart-w-eem"><xsl:value-of select="$moviepath" />/extrathumbs/thumb1.jpg</xsl:variable>



<!--*************Tv show Background options for	use in the skin	do not change unless you're sure you know what you're doing*****************-->

<!--This variable sets the tv fanart to	be named fanart.jpg inside the location	of the tv video	file-->
<xsl:variable name="tvfanart"><xsl:value-of select="$moviepath"	/>/fanart.jpg</xsl:variable>

<!--This variable sets the tv fanart to	be named filename.fanart.jpg inside the	location of the	tv video file-->
<xsl:variable name="tv.fanart-w-videofile"><xsl:value-of select="$moviepath" />/<xsl:call-template name="substring-before-last"><xsl:with-param	name="string" select="details" /><xsl:with-param name="delimiter" select="'.'" /></xsl:call-template>.fanart.jpg</xsl:variable>

<!--This variable sets the tv fanart to	be named filename.fanart.jpg inside the	location of the	tv video file-->
<xsl:variable name="tv.fanart2-w-videofile"><xsl:value-of select="$moviepath" />/<xsl:call-template name="substring-before-last"><xsl:with-param name="string" select="details"	/><xsl:with-param name="delimiter" select="'.'"	/></xsl:call-template>.fanart2.jpg</xsl:variable>


<!--This variable sets the tv fanart to	be named filename-fanart.jpg inside the	location of the	tv video file-->
<xsl:variable name="tv-fanart-w-videofile"><xsl:value-of select="$moviepath" />/<xsl:call-template name="substring-before-last"><xsl:with-param	name="string" select="details" /><xsl:with-param name="delimiter" select="'.'" /></xsl:call-template>-fanart.jpg</xsl:variable>

<!--Background option, have your background file in a custom folder and	name the same as the video file	with .fanart after it.	Example:  batman.avi, batman.html, batman.fanart.jpg-->
<xsl:variable name="tv-fanart-w-customfolder">fanart/<xsl:call-template	name="substring-before-last"><xsl:with-param name="string" select="details" /><xsl:with-param name="delimiter" select="'.'" /></xsl:call-template>.fanart.jpg</xsl:variable>

<!--This variable sets the tv fanart to	be named filename.fanart.jpg inside the	location of the	tv video file-->
<xsl:variable name="tvfanart-w-yamj"><xsl:call-template	name="substring-before-last"><xsl:with-param name="string" select="details" /><xsl:with-param name="delimiter" select="'.'" /></xsl:call-template>.fanart.jpg</xsl:variable>

<!--*************************************************END of TV SHOW BACKGROUND OPTIONS******************************************************-->


<body bgproperties="fixed" bgcolor="000000" text="#AAAAAA" FOCUSTEXT="#AAAAAA" focuscolor="transparent">

<xsl:attribute name="onload">initpage()</xsl:attribute>

<xsl:attribute name="onloadset">
	<xsl:choose>
		<xsl:when test="season = -1"><xsl:value-of select="$detail-start"/></xsl:when>
		<xsl:otherwise>movies4</xsl:otherwise>
	</xsl:choose>
</xsl:attribute>

<xsl:if	test="$use-detail-fanart='true'">
	<xsl:attribute name="background">
		<xsl:choose>
			<xsl:when test="season = -1"> <!--Movies-->
				<xsl:choose>
					<xsl:when test="$use-my-own-moviefanart='true'">
					<xsl:if test="$own-fanart-name='fanart2'"><xsl:value-of select="$movie.fanart2-w-videofile"/></xsl:if>
					<xsl:if test="$own-fanart-name='eem'"><xsl:value-of select="$movie-fanart-w-eem"/></xsl:if></xsl:when>
					<xsl:when test="fanartFile = 'UNKNOWN'">pictures/originalBG.jpg</xsl:when>
					<xsl:otherwise><xsl:value-of select="fanartFile"/></xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:when test="season != -1"> <!--Tvshows-->
				<xsl:choose>
					<xsl:when test="$use-my-own-tvfanart='true'"><xsl:value-of select="$tv.fanart2-w-videofile"/></xsl:when>
					<xsl:when test="fanartFile = 'UNKNOWN'">pictures/originalBG.jpg</xsl:when>
					<xsl:otherwise><xsl:value-of select="fanartFile"/></xsl:otherwise>
				</xsl:choose>
			</xsl:when>
		</xsl:choose>
	</xsl:attribute>
</xsl:if>


<!--*************************Navigation Stuff***************************************-->
<a tvid="setup">
  <xsl:attribute name="href"><xsl:value-of select="baseFilename"/>.html</xsl:attribute>
</a>
<a href="Other_All_1.html" tvid="home"/>
<a href="#" onclick="return togglePopup(1)" id="navchange" tvid="info"/>
<xsl:if	test="season = -1"><a href="#" onclick="return togglePopup2(8)"	id="navchange3"	tvid="clear"/></xsl:if>
<a href="#middle" onfocusload="" onfocus="return changeformat()" onclick="return changeformat()" name="leters" class="sorting2"></a>
<a href="#middle" onfocusload="" onfocus="return upDown(-1)" onclick="return upDown(-1)" name="left" onkeyrightset="middle" id="up"></a>
<a href="#middle" onfocusload="" onfocus="return upDown(1)" onclick="return upDown(1)" name="right" onkeyleftset="middle" id="down"></a>
<a href="#" id="backbutton" tvid="back"/>

<xsl:if test="$parental-control-on !='true' and $use-parental-ratings-type2 !='true'">
<a><xsl:attribute name="TVID">PGDN</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="next"/>.html</xsl:attribute><xsl:attribute name="id">tviddown</xsl:attribute></a>
<a><xsl:attribute name="TVID">PGUP</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="previous"/>.html</xsl:attribute><xsl:attribute name="id">tvidup</xsl:attribute></a>
</xsl:if>

<!--**************************************end of naviagtion stuff*********************-->


<xsl:choose>

<!--********************************************************************START OF MOVIE DETAILS PAGE OPTION 1************************************************************************-->

	<xsl:when test="season = -1">
		<xsl:if test="$detail-page='meow'">
			<xsl:call-template name="meow-movie-html"></xsl:call-template>
		</xsl:if>
		<xsl:if test="$detail-page='details2'">
			<xsl:call-template name="movie-details-2-html"></xsl:call-template>
		</xsl:if>
		<xsl:if test="$detail-page='details1'">
			<xsl:call-template name="movie-details-option-1-html"></xsl:call-template>
		</xsl:if>
	</xsl:when>


<!--********************************************************************START OF TV DETAILS PAGE************************************************************************-->
<xsl:otherwise>
	<xsl:if test="$tv-page='meow'">
		<xsl:call-template name="meow-tv-html"></xsl:call-template>
	</xsl:if>
	<xsl:if test="$tv-page='details1'">
		<xsl:call-template name="tv-details-1-html"></xsl:call-template>
	</xsl:if>
</xsl:otherwise>
</xsl:choose>

<!--********************************************************************END OF TV DETAILS PAGE************************************************************************-->


</body>
</html>
</xsl:template>

</xsl:stylesheet>